﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AbpEntityFrameworkcore.Migrations
{
    /// <inheritdoc />
    public partial class _202511420 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_WarehouseLine_BoxType_BinTypeBoxType_Id",
                table: "WarehouseLine");

            migrationBuilder.RenameColumn(
                name: "BinTypeBoxType_Id",
                table: "WarehouseLine",
                newName: "BoxType_Id");

            migrationBuilder.RenameIndex(
                name: "IX_WarehouseLine_BinTypeBoxType_Id",
                table: "WarehouseLine",
                newName: "IX_WarehouseLine_BoxType_Id");

            migrationBuilder.AddColumn<bool>(
                name: "IsReplenishment",
                table: "PutOutOrder",
                type: "bit",
                nullable: false,
                defaultValue: false,
                comment: "需求补料");

            migrationBuilder.AddColumn<string>(
                name: "printOrder",
                table: "PutOutOrder",
                type: "nvarchar(max)",
                nullable: true,
                comment: "打印工单");

            migrationBuilder.AddColumn<string>(
                name: "printOrder",
                table: "NeetOutMaterial",
                type: "nvarchar(max)",
                nullable: true,
                comment: "打印工单");

            migrationBuilder.AlterColumn<string>(
                name: "Machine",
                table: "Conveyorline",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<string>(
                name: "BoxCode",
                table: "Conveyorline",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AddForeignKey(
                name: "FK_WarehouseLine_BoxType_BoxType_Id",
                table: "WarehouseLine",
                column: "BoxType_Id",
                principalTable: "BoxType",
                principalColumn: "BoxType_Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_WarehouseLine_BoxType_BoxType_Id",
                table: "WarehouseLine");

            migrationBuilder.DropColumn(
                name: "IsReplenishment",
                table: "PutOutOrder");

            migrationBuilder.DropColumn(
                name: "printOrder",
                table: "PutOutOrder");

            migrationBuilder.DropColumn(
                name: "printOrder",
                table: "NeetOutMaterial");

            migrationBuilder.RenameColumn(
                name: "BoxType_Id",
                table: "WarehouseLine",
                newName: "BinTypeBoxType_Id");

            migrationBuilder.RenameIndex(
                name: "IX_WarehouseLine_BoxType_Id",
                table: "WarehouseLine",
                newName: "IX_WarehouseLine_BinTypeBoxType_Id");

            migrationBuilder.AlterColumn<string>(
                name: "Machine",
                table: "Conveyorline",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "BoxCode",
                table: "Conveyorline",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AddForeignKey(
                name: "FK_WarehouseLine_BoxType_BinTypeBoxType_Id",
                table: "WarehouseLine",
                column: "BinTypeBoxType_Id",
                principalTable: "BoxType",
                principalColumn: "BoxType_Id");
        }
    }
}
